<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<c:set var="extLibs" value="validate,fileupload"/>
<sys:header title="广告项列表管理 - ${elecAdList.isNewRecord ? '新增' : '编辑'} 广告项列表" extLibs="${extLibs}"/>
<div class="portlet box ${boxStyleColor} autoHeight">
    <div class="portlet-title">
        <div class="caption"><i class="fa fa-coffee"></i>${elecAdList.isNewRecord ? '新增' : '编辑'}广告项列表</div>
        <%-- <div class="actions">
            <shiro:hasPermission name="ad:elecAdList:edit">
                <a href="#" class="btn btn-default btn-sm" onclick="$('#btnSubmit').click();return false;"><i class="fa fa-check"></i> 保 存</a>
            </shiro:hasPermission>
            <a href="#" class="btn btn-default btn-sm" onclick="$('#btnCancel').click();return false;"><i class="fa fa-reply-all"></i> 关 闭</a>
        </div> --%>
    </div>
    <div class="portlet-body form">
        <form:form id="inputForm" modelAttribute="elecAdList" action="${ctx}/ad/elecAdList/save" method="post"
                   class="form-horizontal">
            <div class="form-body">
                <h4 class="form-section">基本信息</h4>
                <form:hidden path="id"/>
                <form:hidden path="adId"/>
                <form:hidden path="image"/>
                <div class="row">
                    <div class="col-xs-6">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                标题：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <form:input path="title" htmlEscape="false" maxlength="64" class="form-control"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-6">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                排序号：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <form:input path="sorts" htmlEscape="false" maxlength="3" class="form-control digits"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-2" title="">
                                内容：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-10">
                                <form:textarea path="content" htmlEscape="false" rows="4" maxlength="255"
                                               class="form-control"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-2" title="">
                                图片：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-10">
                                <sys:fileupload id="image" bizCategory="elecAdList" bizKey="${elecAdList.id}"
                                                returnPath="true"
                                                uploadType="image" maxUploadNum="1"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-actions fluid">
                    <div class="row">
                        <div class="col-sm-offset-2 col-sm-10">
							<shiro:hasPermission name="ad:elecAd:edit">
								<button id="btnSubmit" type="submit" class="btn btn-primary"><i class="fa fa-check"></i> 保 存
								</button>
							</shiro:hasPermission>
                            <button id="btnCancel" type="button" class="btn default"
                                    onclick="closeCurrentTabPage('${param.parentTabPageId}')"><i
                                    class="fa fa-reply-all"></i> 关 闭
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </form:form>
    </div>
</div>
<sys:footer extLibs="${extLibs}"/>
<script type="text/javascript">

    $("#inputForm").validate({
        submitHandler: function (form) {
            ajaxSubmitForm($(form), function (data) {
                showMessage(data.message);
                if (data.result == Global.TRUE) {
                    closeCurrentTabPage('${param.parentTabPageId}', function (contents, contentWindow) {
                        contentWindow.page();
                    });
                }
            }, "json");
        }
    });
</script>
